﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<%@ Import Namespace="skags.Models" %>

<div class="top_news">
<h2>Mest lesnu fréttir</h2>

    <% foreach (var item in (IEnumerable<NewsViewModel>)ViewData["TopNews"]) { %>
   
       
       <span class="title"><a href="News/ViewItem/<%: item.ID %>"> <%: item.Title %></a></span> <br />
       <span class="categoryName"> <%= item.CategoryName %> </span>  
       <span class="read_count">( <%: item.ReadCount.ToString() == "" ? 0 : item.ReadCount %> )</span> <br />
       <span class="author"> <%: item.CreatorName %> </span>
       <span class="date">Þann <%= String.Format("{0:g}", item.DateCreated) %></span>
        <br /><br />        
    <% } %>
<br />
</div>